Flash memory is characterized by the fact that data cannot be rewritten to a data area that has already been recorded. For this reason, in order to update recorded data, processing is required to erase a recorded area after reading the recorded data and then write update data to the erased unwritten area.
However, the time taken to erase flash memory is long compared to the write time, which greatly lowers the device performance, and therefore a method is typically adopted for a data update, whereby, once the recorded data has been read, update data is generated integrally with the write data, the generated update data is written to another unwritten area, and the original recorded area is invalidated (a process which renders the host system unable to reference this area). When unwritten area is exhausted, invalidated area is erased to generate a new unwritten area.
However, with flash memory, since the minimum erase unit is large in comparison with the minimum write unit, an erased area may sometimes include an area (valid area) which stores valid data which has not been invalidated. It is therefore necessary to write-copy all the valid data in a valid area within an area which is to be erased to another area, invalidate the whole erase-target area, and then delete all the data in the erase target area.
In this processing, it is necessary to sequentially update correspondence between an address space published to the host system and an address space where the internal physical recording area is managed, and management systems serving this purpose have already been disclosed (PTL1, for example).
In PTL1, a logical block, which includes a plurality of physical blocks that are the minimum erase units, holds at least two logical page sets obtained by combining a plurality of physical pages which are minimum write units, where a first logical page set is used in the recording of normal data, and a second logical page set is used to record update data of the first logical page set (hereinafter the first logical page set will be called the base area and the second logical page set will be called the update area). When the update area is exhausted, update area is reserved once again by reading all the data of the logical blocks, erasing all the logical blocks and then rewriting by switching the data of the update area to the base area.
Furthermore, PTL2 discloses a method with which, in response to a change in the stored data volume arising from a conversion algorithm for compression or encryption or the like, the individual units of converted data are identified and, based on the identification result, the stored data is stored in an area with a successive address.